package com.hua.api.modules.express.dao;

import com.hua.api.core.constants.Status;
import com.hua.api.core.framework.statement.EntityManagerTemplate;
import com.hua.api.core.framework.statement.Statement;
import com.hua.api.core.framework.statement.mysql.StatementFactoryImpl;
import com.hua.api.modules.express.domain.ShopInfoExpress;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ShopInfoExpressDao extends EntityManagerTemplate {


    public List<ShopInfoExpress> queryShopInfoExpress(Integer orderId) {
        Statement statement = StatementFactoryImpl.getInstance().createStatement("select s from ShopInfoExpress s, OrderInfo o where s.shopId = o.shopId and o.id=?1 and s.status=?2");
                  statement.addParams(orderId, Status.LOGIC_Y);
        return query(statement, ShopInfoExpress.class);
    }

}
